typescript cast object to subclass. There are any references about typescript cast object to subclass in here. you can look below.